package and.activity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

import com.gfan.sdk.statitistics.GFAgent;

public class BaseActivity extends Activity{
	protected EditText ed;
	@Override
	protected void onResume() {
		GFAgent.onResume(this);
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		GFAgent.onPause(this);
		super.onPause();
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		menu.add(0, 1, 1, "作者信息");
		menu.add(0, 2, 2, "退出");
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == 1) {
			new AlertDialog.Builder(getNowActivity()).setTitle(item.getTitle()).setMessage(
					"橘子出品\nQQ:344705186").setPositiveButton("确定",
					new DialogInterface.OnClickListener() {
						public void onClick(DialogInterface dialog, int which) {
							dialog.dismiss();
						}
					}).show();
		}else if (item.getItemId() == 2) {
			
		}else if (item.getItemId() == 3) {
			finish();
		}
		return super.onOptionsItemSelected(item);
	}
	private Activity nowActivity = this;
	public Activity getNowActivity() {
		return nowActivity;
	}

	public void setNowActivity(Activity nowActivity) {
		this.nowActivity = nowActivity;
	}

}
